/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cassandrawindow;

import java.util.Map;

/**
 *
 * @author ADMIN
 */
public class ThreadBannerHourly implements Runnable{
    public static final String ColumFamlyBannerViewCountCf   =   "BannerViewCountCf";
    public static final String ColumFamlyBannerClickCountCf   =   "BannerClickCountCf";
    CassandraAction cassAct ;
    String currentDate = "";   
    String bannerid = "";
    StringBuilder sb;
    Thread runner;

    public ThreadBannerHourly(CassandraAction cassActValue,String banneridValue, String dayStartValue,StringBuilder sbff)
    {
        sb          =   sbff;
        cassAct     =   cassActValue;
        currentDate =   dayStartValue;
        bannerid    =   banneridValue;
        runner      =   new Thread(this);
        runner.start();
    }

    public void run()
    {
        HandleDataTableBannerHourV2 htb = new HandleDataTableBannerHourV2();        
        try {
            String view_hour    = htb.getClickInDay(cassAct, currentDate, bannerid, ColumFamlyBannerViewCountCf);
            String click_hour   = htb.getClickInDay(cassAct, currentDate, bannerid, ColumFamlyBannerClickCountCf);
            //String str = "("+ bannerid + "," +"'"+ click_hour + "'" + "," + "'" + view_hour + "'" +",'" + currentDate +"')";
            String str = "("+ bannerid + "|" +"'"+ click_hour + "'" + "|" + "'" + view_hour + "'" +"|'" + currentDate +"')";
            sb.append(str).append(",");
            //Thread.sleep(5*1000);
        } catch (Exception ex){}
    }
       
}
